package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import com.creawor.imei.base.*;
import com.creawor.imei.util.*;
import com.creawor.hz_market.t_balance_office.*;
import com.creawor.km.util.*;
import java.util.*;
import com.creawor.km.util.CatcheUtil;
import com.creawor.hz_market.util.QueryByCounty;
import com.creawor.km.util.SqlCreator;;

public final class show_005fmicro_005fview_005fgooglemap_005fcm_005fall_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.List _jspx_dependants;

  static {
    _jspx_dependants = new java.util.ArrayList(2);
    _jspx_dependants.add("/googlemap_include.jsp");
    _jspx_dependants.add("/googlemap_include2.jsp");
  }

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=GBK");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<head>\r\n");
      out.write("    <meta http-equiv=\"content-type\" content=\"text/html; charset=GBK\"/>\r\n");
      out.write("    <title>Google</title>\r\n");
      out.write("\t<link rel=\"stylesheet\" href=\"../css/style.css\">\r\n");
      out.write("\t<link href=\"css/css.css\" rel=\"stylesheet\" type=\"text/css\">\r\n");
      out.write("\t");
      out.write(" <script charset=\"utf-8\" src=\"http://ditu.google.com/maps?file=api&hl=zh-CN&v=2&key=ABQIAAAAR8j_txeDk-DuXGxZubZrtBTNbbnogSBxh_Nk7_EXsE7U28rZzhRuae1s3mx46DxESba3ScI3uehdbg\" type=\"text/javascript\"></script>");
      out.write("\r\n");
      out.write("\t<script src=\"js/prototype-1.4.0.js\"></script>\r\n");
      out.write("    <script  type=\"text/javascript\">\r\n");
      out.write("\t");

	//System.gc()
	SqlCreator.informationSql("2008-06-1",request);
	
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("function TextualZoomControl() {\r\n");
      out.write("    }\r\n");
      out.write("\t\r\n");
      out.write("    TextualZoomControl.prototype = new GControl();\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("    TextualZoomControl.prototype.initialize = function(map) {\r\n");
      out.write("      var container = document.createElement(\"div\");\r\n");
      out.write(" var fullScreenDiv = document.createElement(\"div\");\r\n");
      out.write("\t   var resScreenDiv = document.createElement(\"div\");\r\n");
      out.write("\t  var maxS=document.createTextNode(\"全屏\");\r\n");
      out.write("\t\tresScreenDiv.style.display=\"none\";\r\n");
      out.write("\t  //zoomInDiv.style.font=\"small Arial 1em\";\r\n");
      out.write("\r\n");
      out.write("      this.setButtonStyle_(fullScreenDiv);\r\n");
      out.write("      container.appendChild(fullScreenDiv);\r\n");
      out.write("     \r\n");
      out.write("      fullScreenDiv.appendChild(maxS);\r\n");
      out.write("\r\n");
      out.write("\t  //mixS.style.display=none;\r\n");
      out.write("      GEvent.addDomListener(fullScreenDiv, \"click\", function FullScreen(){\r\n");
      out.write("\t \r\n");
      out.write("\tvar top=parent.document.getElementById(\"topmain\");\r\n");
      out.write("\tvar left=parent.document.getElementById(\"leftmain\");\r\n");
      out.write("\tvar bottom=parent.document.getElementById(\"bottommain\");\r\n");
      out.write("\tvar frm=document.getElementById(\"map_canvas\");\r\n");
      out.write("\tfrm.style.width='101.5%';\r\n");
      out.write("\t\ttop.border=0;\r\n");
      out.write("\t\ttop.rows='0,*';\r\n");
      out.write("\t\tleft.border=0\r\n");
      out.write("\t\tleft.cols='0,*';\r\n");
      out.write("\t\tbottom.border=0;\r\n");
      out.write("\t\tbottom.rows=\"*,0\";\r\n");
      out.write("\r\n");
      out.write("\t\tfullScreenDiv.style.display=\"none\";\r\n");
      out.write("\t\tresScreenDiv.style.display=\"block\";\r\n");
      out.write("\r\n");
      out.write("});\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\t  var mixS=document.createTextNode(\"退出全屏\");\r\n");
      out.write("\t  //zoomInDiv.style.font=\"small Arial 1em\";\r\n");
      out.write("\r\n");
      out.write("      this.setButtonStyle_(resScreenDiv);\r\n");
      out.write("      container.appendChild(resScreenDiv);\r\n");
      out.write("     \r\n");
      out.write("\r\n");
      out.write("\t  resScreenDiv.appendChild(mixS);\r\n");
      out.write("\t  //mixS.style.display=none;\r\n");
      out.write("      GEvent.addDomListener(resScreenDiv, \"click\", function FullScreen(){\r\n");
      out.write("\t  \t \r\n");
      out.write("\r\n");
      out.write("\tvar top=parent.document.getElementById(\"topmain\");\r\n");
      out.write("\tvar left=parent.document.getElementById(\"leftmain\");\r\n");
      out.write("\tvar bottom=parent.document.getElementById(\"bottommain\");\r\n");
      out.write("\tvar frm=document.getElementById(\"map_canvas\");\r\n");
      out.write("\tfrm.style.width='102%';\r\n");
      out.write("\t\ttop.border=5;\r\n");
      out.write("\t\ttop.rows='80,*';\r\n");
      out.write("\t\tleft.border=5;\r\n");
      out.write("\t\tleft.cols='248,*';\r\n");
      out.write("\t\tbottom.border=5;\r\n");
      out.write("\t\tbottom.rows=\"*,137\";\r\n");
      out.write("\t\t//document.getElementById(\"screentitle\").value=\"全屏\"\r\n");
      out.write("\r\n");
      out.write("\t\t// fullScreenDiv.appendChild(document.createTextNode(document.getElementById(\"screentitle\").value));\r\n");
      out.write("\t\t fullScreenDiv.style.display=\"block\";\r\n");
      out.write("\t\t  resScreenDiv.style.display=\"none\";\r\n");
      out.write("\t\r\n");
      out.write("});\r\n");
      out.write("      var zoomInDiv = document.createElement(\"div\");\r\n");
      out.write("\t  //zoomInDiv.style.font=\"small Arial 1em\";\r\n");
      out.write("\r\n");
      out.write("      this.setButtonStyle_(zoomInDiv);\r\n");
      out.write("      container.appendChild(zoomInDiv);\r\n");
      out.write("      zoomInDiv.appendChild(document.createTextNode(\"地图\"));\r\n");
      out.write("      GEvent.addDomListener(zoomInDiv, \"click\", function() {\r\n");
      out.write("\t \tmap.setMapType(G_NORMAL_MAP);\r\n");
      out.write("        \r\n");
      out.write("      });\r\n");
      out.write("\r\n");
      out.write("      var zoomOutDiv = document.createElement(\"div\");\r\n");
      out.write("\r\n");
      out.write("      this.setButtonStyle_(zoomOutDiv);\r\n");
      out.write("      container.appendChild(zoomOutDiv);\r\n");
      out.write("      zoomOutDiv.appendChild(document.createTextNode(\"地形地图\"));\r\n");
      out.write("      GEvent.addDomListener(zoomOutDiv, \"click\", function() {\r\n");
      out.write("\t  \tmap.setMapType(G_PHYSICAL_MAP);\r\n");
      out.write("        \r\n");
      out.write("      });\r\n");
      out.write("\r\n");
      out.write("      map.getContainer().appendChild(container);\r\n");
      out.write("      return container;\r\n");
      out.write("    }\r\n");
      out.write("\r\n");
      out.write("    TextualZoomControl.prototype.getDefaultPosition = function() {\r\n");
      out.write("      return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(17, 7));\r\n");
      out.write("    }\r\n");
      out.write("\r\n");
      out.write("    TextualZoomControl.prototype.setButtonStyle_ = function(button) {\r\n");
      out.write("      button.style.textDecoration = \"underline\";\r\n");
      out.write("      button.style.color = \"#0000cc\";\r\n");
      out.write("      button.style.backgroundColor = \"white\";\r\n");
      out.write("      button.style.font = \"small-caps   9pt   serif\";\r\n");
      out.write("\t \r\n");
      out.write("      button.style.border = \"1px solid black\";\r\n");
      out.write("      button.style.padding = \"2px\";\r\n");
      out.write("      button.style.marginBottom = \"3px\";\r\n");
      out.write("      button.style.textAlign = \"center\";\r\n");
      out.write("      button.style.width = \"5em\";\r\n");
      out.write("      button.style.cursor = \"pointer\";\r\n");
      out.write("    }\r\n");
      out.write("\r\n");
      out.write("\t\r\n");
      out.write("\tvar map = null;\r\n");
      out.write("    var geocoder = null;\r\n");
      out.write("\tvar baseIcon=null;\r\n");
      out.write("    function initialize() {\r\n");
      out.write("      if (GBrowserIsCompatible()) {\r\n");
      out.write("\t  \r\n");
      out.write("         map = new GMap2(document.getElementById(\"map_canvas\"));\r\n");
      out.write("\t\tmap.addControl(new GSmallMapControl());\r\n");
      out.write("\t\t//map.addControl(new GMapTypeControl()); \r\n");
      out.write("\t\tmap.addControl(new GOverviewMapControl());\r\n");
      out.write("     \tmap.enableDoubleClickZoom();\r\n");
      out.write("     \tmap.enableScrollWheelZoom();\r\n");
      out.write("     \tmap.enableContinuousZoom(); //\r\n");
      out.write("\t\t//map.setMapType(G_PHYSICAL_MAP);\r\n");
      out.write("\t\t//shao guan is (24.996016,113.59314).\r\n");
      out.write("        //map.setCenter(new GLatLng(24.816498,113.597088), 14);\r\n");
      out.write("\t\t//huizhou is (22.87965466225453,114.5438003540039)\r\n");
      out.write("\t\tmap.setCenter(new GLatLng(24.996016,113.59314), 9);\r\n");
      out.write("\t\tmap.addControl(new TextualZoomControl());\r\n");
      out.write("\r\n");
      out.write("\t\tbaseIcon = new GIcon();\r\n");
      out.write("        baseIcon.shadow = \"http://www.google.com/mapfiles/shadow50.png\";\r\n");
      out.write("        baseIcon.iconSize = new GSize(20, 20);\r\n");
      out.write("        baseIcon.shadowSize = new GSize(37, 34);\r\n");
      out.write("        baseIcon.iconAnchor = new GPoint(9, 34);\r\n");
      out.write("        baseIcon.infoWindowAnchor = new GPoint(9, 2);\r\n");
      out.write("        baseIcon.infoShadowAnchor = new GPoint(18, 25);\r\n");
      out.write("\t\tvar point =null;\r\n");
      out.write("\t\t\r\n");
      out.write("\t\t\r\n");
      out.write("\t\r\n");

//展示所有钩选的内容
//System.out.println("all the conditions.....");
String year = request.getParameter("year");
String month = request.getParameter("month");
String day = request.getParameter("day");
String qryDate= year+"-"+month+"-"+day;
Map fieldmap = (Map)application.getAttribute("filedMap");
ArrayList keycodes = new ArrayList();
String tablename="";
StringBuffer sql=new StringBuffer();
String sql2="";
String[] channelitems = request.getParameterValues("channelitem");
String[] channelguihuaitems = request.getParameterValues("channelguihuaitem");
String[] serviceitem=request.getParameterValues("serviceitem");

String[] jingzhengs = request.getParameterValues("jingzheng");
String[] countys = request.getParameterValues("county");
String[] townitems = request.getParameterValues("townitem");
	
String[] stars = request.getParameterValues("star");
String[] groups = request.getParameterValues("group");
String conditiontext =request.getParameter("conditiontext");

String chaxun=request.getParameter("chaxun");
if(null!=chaxun){
	conditiontext=null;
}
if(null!=conditiontext){
	if("".equals(conditiontext.trim()))
		conditiontext=null;
}


String starWhere=QueryByCounty.createInWhereStr(stars);
String groupWhere=QueryByCounty.createInWhereStr(groups);
//保存条件，作为ajax抽取条件

session.setAttribute("jingzhengs",jingzhengs);
session.setAttribute("channelitems",channelitems);
session.setAttribute("conditiontext",conditiontext);
session.setAttribute("countys",countys);
session.setAttribute("townitems",townitems);
session.setAttribute("starWhere",starWhere);
session.setAttribute("qryDate",qryDate);
////////////////////////////qryDate////////////////////////////////////////
//channel information    
if(null!=channelitems )
{
	keycodes.add("sg_channel");
	//System.out.println("countys.length="+countys.length);
	tablename ="t_channel";
	//for(int i=0;i<countys.length;i++)
	for(int i=0;i<townitems.length;i++)
	{
		if(i==0)
		{
			//sql="select t_channel_sale.*,t_channel.* from t_channel,t_channel_sale,t_county where   t_channel.main_type is null and t_channel.county=t_county.county_name and  t_channel.service_hall_code = t_channel_sale.channel_code and    county_name in ('"+countys[i]+"'";
			sql.append("select t_channel_sale.*,t_channel.* from t_channel,t_channel_sale where   t_channel.main_type is null and   t_channel.service_hall_code = t_channel_sale.channel_code and    town in ('").append(townitems[i]).append("'");
		}
		
		if(i<townitems.length-1)
		{
			//sql+=",'";
			sql.append(",'")
			.append(townitems[i+1])
			.append("'");
			//sql+=townitems[i+1];
			//sql+="'";
		}
	}
	//sql+= " ) ";
	sql.append(" ) ")
	.append(" and datediff(month,CONVERT(varchar, t_channel_sale.insert_day, 120),'")
	.append(qryDate).append("') =0");
	//sql+= " and datediff(month,CONVERT(varchar, t_channel_sale.insert_day, 120),'"+qryDate+"') =0";
//	2008-09-06 添加渠道的星级过滤
	if(null!=starWhere){
		//sql+=" and t_channel.star_level in ("+starWhere+")";
		sql.append(" and t_channel.star_level in (").append(starWhere).append(")");
	}
	if(null!=conditiontext){
		//sql+=" and t_channel.service_hall_name like '%"+conditiontext+"%'";
		sql.append(" and t_channel.service_hall_name like '%").append(conditiontext).append("%'");
	}
}

Common_qry_QueryMap query_map0 = new Common_qry_QueryMap();
	
//1. get the rules
System.out.println("@@@@@@@@@@@@@@sql="+sql.toString());

ArrayList sl = null;
if(!"".equals(sql.toString()))
{
	sl=(ArrayList)CatcheUtil.getInstance().getObject(sql.toString());
	if(null==sl || sl.size()<1){
	  sl = query_map0.findAll(sql.toString());
	  CatcheUtil.getInstance().cacheObj(sql.toString(),sl);
	 }
	 
List clist=QueryByCounty.channel(countys,qryDate,starWhere,conditiontext);
if(null!=clist && clist.size()>0)
	sl.addAll(clist);
QueryMultiConditions.printGoogleMap(sl,channelitems,"channelitem",tablename,fieldmap,out,request,jingzhengs);
}
sql.setLength(0);
/////////////////////////////////////////////
if(null!=channelguihuaitems)
{
	keycodes.add("sg_channel");
	//System.out.println("countys.length="+countys.length);
	tablename ="channelguihuaitem";
	//for(int i=0;i<countys.length;i++)
	for(int i=0;i<townitems.length;i++)
	{
		if(i==0)
		{
			//sql="select t_channel_sale.*,t_channel.* from t_channel,t_channel_sale,t_county where  t_channel.main_type='1' and t_channel.county=t_county.county_name and  t_channel.service_hall_code = t_channel_sale.channel_code and    county_name in ('"+countys[i]+"'";
			//sql="select t_channel.* from t_channel where  t_channel.main_type='1'  and   town in ('"+townitems[i]+"'";
			sql.append("select t_channel.* from t_channel where  t_channel.main_type='1'  and   town in ('").append(townitems[i]).append("'");
		}
		
		if(i<townitems.length-1)
		{
			//sql+=",'";
			//sql+=townitems[i+1];
			//sql+="'"
			sql.append(",'").append(townitems[i+1]).append("'");
		}
	}
	//sql+= " ) ";
	//sql+= " and datediff(month,CONVERT(varchar, t_channel.insert_day, 120),'"+qryDate+"') =0";
	sql.append(" ) ").append(" and datediff(month,CONVERT(varchar, t_channel.insert_day, 120),'").append(qryDate).append("') =0");
	if(null!=conditiontext){
		//sql+=" and t_channel.service_hall_name like '%"+conditiontext+"%'";
		sql.append(" and t_channel.service_hall_name like '%").append(conditiontext).append("%'");
	}
	
	sl=(ArrayList)CatcheUtil.getInstance().getObject(sql.toString());
	if(null==sl || sl.size()<1){
	  sl = query_map0.findAll(sql.toString());
	  CatcheUtil.getInstance().cacheObj(sql.toString(),sl);
	 }
	 
	
	List sl2=QueryByCounty.layoutChannel(countys,qryDate,conditiontext);
	if(null!=sl2 && sl2.size()>0)
		sl.addAll(sl2);
	//System.out.println("channelguihuaitem sql="+sql);
	QueryMultiConditions.printGoogleMap(sl,channelguihuaitems,"channelguihuaitem",tablename,fieldmap,out,request,jingzhengs);
}
sql.setLength(0);
if(null!=serviceitem)
{
	keycodes.add("serviceitem");
	//System.out.println("countys.length="+countys.length);
	tablename ="t_hall";
	
	//for(int i=0;i<countys.length;i++)
	for(int i=0;i<townitems.length;i++)
	{
		if(i==0)
		{
			//sql="select t_hall_sale.*,t_hall.* from t_hall,t_hall_sale,t_county where  t_hall.county=t_county.county_name and  t_hall.service_hall_code = t_hall_sale.service_hall_code and    county_name in ('"+countys[i]+"'";
			//sql="select t_hall_sale.*,t_hall.* from t_hall,t_hall_sale where    t_hall.service_hall_code = t_hall_sale.service_hall_code and    town in ('"+townitems[i]+"'";
			sql.append("select t_hall_sale.*,t_hall.* from t_hall,t_hall_sale where    t_hall.service_hall_code = t_hall_sale.service_hall_code and    town in ('").append(townitems[i]).append("'");
		}
		
		if(i<townitems.length-1)
		{
			//sql+=",'";
			//sql+=townitems[i+1];
			//sql+="'";
			sql.append(",'").append(townitems[i+1]).append("'");
		}
	}
	//sql+= " ) ";
	//sql+= " and datediff(month,CONVERT(varchar, t_hall_sale.insert_day, 120),'"+qryDate+"') =0";
	sql.append(" ) ")
	.append(" and datediff(month,CONVERT(varchar, t_hall_sale.insert_day, 120),'").append(qryDate).append("') =0");
	if(null!=conditiontext){
		//sql+=" and t_hall.service_hall_name like '%"+conditiontext+"%'";
		sql.append(" and t_hall.service_hall_name like '%").append(conditiontext).append("%'");
	}
	sl=(ArrayList)CatcheUtil.getInstance().getObject(sql.toString());
	if(null==sl || sl.size()<1){
	  sl = query_map0.findAll(sql.toString());
	  CatcheUtil.getInstance().cacheObj(sql.toString(),sl);
	 }
	
	
	//System.out.println("serviceitem sql="+sql);
	List sl2=QueryByCounty.hall(countys,qryDate,conditiontext);
	if(null!=sl2 && sl2.size()>0)
		sl.addAll(sl2);
	QueryMultiConditions.printGoogleMap(sl,serviceitem,"serviceitem",tablename,fieldmap,out,request,jingzhengs);
}
sql.setLength(0);


// group information
if(null!=request.getParameterValues("groupitem"))
{
	keycodes.add("groupitem");
	channelitems=request.getParameterValues("groupitem");
	
	tablename ="t_group";
	//for(int i=0;i<countys.length;i++)
	for(int i=0;i<townitems.length;i++)
	{
		if(i==0)
		{
			//sql="select t_group.* from t_group,t_county where  t_group.county=t_county.county_name and    county_name in ('"+countys[i]+"'";
			//sql="select t_group.* from t_group where  town in ('"+townitems[i]+"'";
			sql.append("select t_group.* from t_group where  town in ('").append(townitems[i]).append("'");
		}
		
		if(i<townitems.length-1)
		{
			//sql+=",'";
			//sql+=townitems[i+1];
			//sql+="'";
			sql.append(",'").append(townitems[i+1]).append("'");
		}
	}
	//sql+= " ) ";
	//sql+= " and datediff(month,CONVERT(varchar, t_group.insert_day, 120),'"+qryDate+"') =0";
	sql.append(" ) ")
	.append(" and datediff(month,CONVERT(varchar, t_group.insert_day, 120),'").append(qryDate).append("') =0");
	if(null!=conditiontext){
		//sql+=" and t_group.group_name like '%"+conditiontext+"%'";
		sql.append(" and t_group.group_name like '%").append(conditiontext).append("%'");
	}
	//	2008-09-06 添加集团的类别过滤
	if(null!=groupWhere){
		//sql+=" and t_group.grouptype in ("+groupWhere+")";
		sql.append(" and t_group.grouptype in (").append(groupWhere).append(")");
	}
	//sql+=" and main_type is null";
	sql.append(" and main_type is null");
	
	sl=(ArrayList)CatcheUtil.getInstance().getObject(sql.toString());
	if(null==sl || sl.size()<1){
	  sl = query_map0.findAll(sql.toString());
	  CatcheUtil.getInstance().cacheObj(sql.toString(),sl);
	 }
	 
	//System.out.println("group sql="+sql);
	List sl2=QueryByCounty.group(countys,qryDate,groupWhere,conditiontext);
	if(null!=sl2 && sl2.size()>0)
		sl.addAll(sl2);
		//System.out.println("++++++++++++++sl.size()++++++++"+sl.size());
	QueryMultiConditions.printGoogleMap(sl,channelitems,"groupitem",tablename,fieldmap,out,request,jingzhengs);
sql.setLength(0);

//集团
if(null!=request.getParameterValues("aimgroup"))
{
	keycodes.add("aimgroupitem");
	channelitems=request.getParameterValues("aimgroup");
	
	tablename ="t_group";
	//for(int i=0;i<countys.length;i++)
	for(int i=0;i<townitems.length;i++)
	{
		if(i==0)
		{
			//sql="select t_group.* from t_group,t_county where  t_group.county=t_county.county_name and    county_name in ('"+countys[i]+"'";
			//sql="select t_group.* from t_group where  town in ('"+townitems[i]+"'";
			sql.append("select t_group.* from t_group where  town in ('").append(townitems[i]).append("'");
		}
		
		if(i<townitems.length-1)
		{
			//sql+=",'";
			//sql+=townitems[i+1];
			//sql+="'";
			sql.append(",'").append(townitems[i+1]).append("'");
		}
	}
	//sql+= " ) ";
	//sql+= " and main_type is not null and datediff(month,CONVERT(varchar, t_group.insert_day, 120),'"+qryDate+"') =0";
	sql.append(" ) ")
	.append(" and main_type is not null and datediff(month,CONVERT(varchar, t_group.insert_day, 120),'").append(qryDate).append("') =0");
	if(null!=groupWhere){
		//sql+=" and t_group.grouptype in ("+groupWhere+")";
		sql.append(" and t_group.grouptype in (").append(groupWhere).append(")");
	}
	if(null!=conditiontext){
		//sql+=" and t_group.group_name like '%"+conditiontext+"%'";
		sql.append(" and t_group.group_name like '%").append(conditiontext).append("%'");
	}
	sl=(ArrayList)CatcheUtil.getInstance().getObject(sql.toString());
	if(null==sl || sl.size()<1){
	  sl = query_map0.findAll(sql.toString());
	  CatcheUtil.getInstance().cacheObj(sql.toString(),sl);
	 }
	//sl = query_map0.findAll(sql);
	//System.out.println("aimgroupitem sql="+sql);
	List sl2=QueryByCounty.aimgroup(countys,qryDate,conditiontext);
	if(null!=sl2 && sl2.size()>0)
		sl.addAll(sl2);
	QueryMultiConditions.printGoogleMap(sl,channelitems,"aimgroupitem",tablename,fieldmap,out,request,jingzhengs);
}
sql.setLength(0);
//advertisement information
if(null!=request.getParameterValues("aditem"))
{
	keycodes.add("aditem");
	channelitems=request.getParameterValues("aditem");
	//System.out.println("countys.length="+countys.length);
	tablename ="t_advertisement";
	//for(int i=0;i<countys.length;i++)
	for(int i=0;i<townitems.length;i++)
	{
		if(i==0)
		{
			//sql="select t_advertisement.* from t_advertisement,t_county where  t_advertisement.county=t_county.county_name and    county_name in ('"+countys[i]+"'";
			//sql="select t_advertisement.* from t_advertisement  where      town in ('"+townitems[i]+"'";
			sql.append("select t_advertisement.* from t_advertisement  where      town in ('").append(townitems[i]).append("'");
		}
		
		if(i<townitems.length-1)
		{
			//sql+=",'";
			//sql+=townitems[i+1];
			//sql+="'";
			sql.append(",'").append(townitems[i+1]).append("'");
		}
	}
	//sql+= " ) ";
	//sql+= " and datediff(month,CONVERT(varchar, t_advertisement.insert_day, 120),'"+qryDate+"') =0";
	sql.append(" ) ").append(" and datediff(month,CONVERT(varchar, t_advertisement.insert_day, 120),'")
	.append(qryDate).append("') =0");
	if(null!=conditiontext){
		//sql+=" and t_advertisement.the_content like '%"+conditiontext+"%'";
		sql.append(" and t_advertisement.the_content like '%").append(conditiontext).append("%'");
	}
	//System.out.println("sq3="+sql);
	sl=(ArrayList)CatcheUtil.getInstance().getObject(sql.toString());
	if(null==sl || sl.size()<1){
	  sl = query_map0.findAll(sql.toString());
	  CatcheUtil.getInstance().cacheObj(sql.toString(),sl);
	 }
	//sl = query_map0.findAll(sql);
	List sl2=QueryByCounty.advertisement(countys,qryDate,conditiontext);
	if(null!=sl2 && sl2.size()>0)
		sl.addAll(sl2);
	QueryMultiConditions.printGoogleMap(sl,channelitems,"aditem",tablename,fieldmap,out,request,jingzhengs);
}

//社区信息
if(null!=request.getParameterValues("shehui"))
{
	keycodes.add("shehui");
	channelitems=request.getParameterValues("shehui");
	//System.out.println("countys.length="+countys.length);
	tablename ="t_community";
	//for(int i=0;i<countys.length;i++)
	for(int i=0;i<townitems.length;i++)
	{
		if(i==0)
		{
			//sql="select t_advertisement.* from t_advertisement,t_county where  t_advertisement.county=t_county.county_name and    county_name in ('"+countys[i]+"'";
			//sql="select t_community.* from t_community  where      t_community.town in ('"+townitems[i]+"'";
			sql.append("select t_community.* from t_community  where      t_community.town in ('").append(townitems[i]).append("'");
		}
		
		if(i<townitems.length-1)
		{
			//sql+=",'";
			//sql+=townitems[i+1];
			//sql+="'";
			sql.append(",'").append(townitems[i+1]).append("'");
		}
	}
	//sql+= " ) ";
	//sql+= " and datediff(month,CONVERT(varchar, t_community.insert_day, 120),'"+qryDate+"') =0";
       sql.append(" ) ")
       .append(" and datediff(month,CONVERT(varchar, t_community.insert_day, 120),'").append(qryDate).append("') =0");
       if(null!=conditiontext){
		//sql+=" and t_community.cell_name like '%"+conditiontext+"%'";
		sql.append(" and t_community.cell_name like '%").append(conditiontext).append("%'");
	}
	//System.out.println("sq3="+sql);
	sl=(ArrayList)CatcheUtil.getInstance().getObject(sql.toString());
	if(null==sl || sl.size()<1){
	  sl = query_map0.findAll(sql.toString());
	  CatcheUtil.getInstance().cacheObj(sql.toString(),sl);
	 }
	//sl = query_map0.findAll(sql);
	List sl2=QueryByCounty.community(townitems,qryDate,conditiontext);
	if(null!=sl2 && sl2.size()>0)
		sl.addAll(sl2);
	QueryMultiConditions.printGoogleMap(sl,channelitems,"shehui",tablename,fieldmap,out,request,jingzhengs);
}
sql.setLength(0);
//basestation information
if(null!=request.getParameterValues("baseinfo"))
{
	keycodes.add("basestationitem");
	channelitems=request.getParameterValues("baseinfo");
	//System.out.println("jingzhengs="+jingzhengs[0]);
	
	tablename ="t_basestation";
	//for(int i=0;i<countys.length;i++)
	for(int i=0;i<townitems.length;i++)
	{
		if(i==0)
		{
			//sql="select t_basestation.* from t_basestation,t_county where  t_basestation.county=t_county.county_name and    t_basestation.county in ('"+countys[i]+"'";
			//sql="select t_basestation.* from t_basestation where     t_basestation.town in ('"+townitems[i]+"'";
			sql.append("select t_basestation.* from t_basestation where     t_basestation.town in ('").append(townitems[i]).append("'");
		}
		
		//if(i<countys.length-1)
		if(i<townitems.length-1)
		{
			//sql+=",'";
			//sql+=countys[i+1];
			//sql+=townitems[i+1];
			//sql+="'";
			sql.append(",'").append(townitems[i+1]).append("'");
		}
	}
	//sql+= " ) ";
	//sql+= " and datediff(month,CONVERT(varchar, t_basestation.insert_day, 120),'"+qryDate+"') =0";
	sql.append(" ) ")
	.append(" and datediff(month,CONVERT(varchar, t_basestation.insert_day, 120),'").append(qryDate).append("') =0");
	if(null!=conditiontext){
		//sql+=" and t_basestation.name like '%"+conditiontext+"%'";
		sql.append(" and t_basestation.name like '%").append(conditiontext).append("%'");
	}
	if(jingzhengs!=null)
	{
		//sql+=" and company in ('移动',";
		sql.append(" and company in ('移动',");
		for (int i = 0; i < jingzhengs.length; i++) {
			String tmp = jingzhengs[i];
			//sql+="'"+tmp+"'";
			sql.append("'").append(tmp).append("'");
			if(i<jingzhengs.length-1)
			{
				//sql+=" , ";
				sql.append(" , ");
			}
		}
		//sql+=" ) ";
		sql.append(" ) ");
	}
	else
	{
		//sql+=" and company ='移动'";
		sql.append(" and company ='移动'");
	}
	sl=(ArrayList)CatcheUtil.getInstance().getObject(sql.toString());
	if(null==sl || sl.size()<1){
	  sl = query_map0.findAll(sql.toString());
	  CatcheUtil.getInstance().cacheObj(sql.toString(),sl);
	 }
	//sl = query_map0.findAll(sql);
	//System.out.println("sql5="+sql+" and sl.size="+sl.size());
	List sl2=QueryByCounty.basestation(countys,qryDate,jingzhengs,conditiontext);
	if(null!=sl2 && sl2.size()>0)
		sl.addAll(sl2);
	
	QueryMultiConditions.printGoogleMap(sl,channelitems,"basestationitem",tablename,fieldmap,out,request,jingzhengs);
}
sql.setLength(0);
//规划基站
if(null!=request.getParameterValues("guihuabaseinfo"))
{
	keycodes.add("guihuabaseinfoitem");
	channelitems=request.getParameterValues("guihuabaseinfo");
	//System.out.println("countys.length="+countys.length);
	
	tablename ="t_layoutbase";
	//for(int i=0;i<countys.length;i++)
	for(int i=0;i<townitems.length;i++)
	{
		if(i==0)
		{
			
			//sql="select t_layoutbase.* from t_layoutbase where     t_layoutbase.town in ('"+townitems[i]+"'";
			sql.append("select t_layoutbase.* from t_layoutbase where     t_layoutbase.town in ('").append(townitems[i]).append("'");
		}
		
		//if(i<countys.length-1)
		if(i<townitems.length-1)
		{
			//sql+=",'";
			//sql+=townitems[i+1];
			//sql+="'";
			sql.append(",'").append(townitems[i+1]).append("'");
		}
	}
	//sql+= " ) ";
	//sql+= " and datediff(month,CONVERT(varchar, t_layoutbase.new_base_time, 120),'"+qryDate+"') =0";
	sql.append(" ) ")
	.append(" and datediff(month,CONVERT(varchar, t_layoutbase.new_base_time, 120),'").append(qryDate).append("') =0");
	if(null!=conditiontext){
		//sql+=" and t_layoutbase.basestation_name like '%"+conditiontext+"%'";
		sql.append(" and t_layoutbase.basestation_name like '%")
		.append(conditiontext).append("%'");
	}
	sl=(ArrayList)CatcheUtil.getInstance().getObject(sql.toString());
	if(null==sl || sl.size()<1){
	  sl = query_map0.findAll(sql.toString());
	  CatcheUtil.getInstance().cacheObj(sql.toString(),sl);
	 }
	//sl = query_map0.findAll(sql);
	List sl2=QueryByCounty.layoutbase(countys,qryDate,conditiontext);
	if(null!=sl2 && sl2.size()>0)
		sl.addAll(sl2);
	//System.out.println("sql5="+sql);
	QueryMultiConditions.printGoogleMap(sl,channelitems,"guihuabaseinfoitem",tablename,fieldmap,out,request,jingzhengs);
}

sql.setLength(0);
//网络覆盖信息 coverinfo
if(null!=request.getParameterValues("coverinfo"))
{
	keycodes.add("coverinfoitem");
	channelitems=request.getParameterValues("coverinfo");
	//System.out.println("countys.length="+countys.length);
	
	tablename ="t_village_signal";
	//for(int i=0;i<countys.length;i++)
	for(int i=0;i<townitems.length;i++)
	{
		if(i==0)
		{
			//sql="select t_basestation.* from t_basestation,t_county where  t_basestation.county=t_county.county_name and    t_basestation.county in ('"+countys[i]+"'";
			//sql="select t_village_signal.* from t_village_signal where     t_village_signal.town in ('"+townitems[i]+"'";
			sql.append("select t_village_signal.* from t_village_signal where     t_village_signal.town in ('").append(townitems[i]).append("'");
		}
		
		//if(i<countys.length-1)
		if(i<townitems.length-1)
		{
			//sql+=",'";
			//sql+=townitems[i+1];
			//sql+="'";
			sql.append(",'")
			.append(townitems[i+1]).append("'");
		}
	}
	//sql+= " ) ";
	//sql+= " and datediff(month,CONVERT(varchar, t_village_signal.insert_day, 120),'"+qryDate+"') =0";
	sql.append(" ) ")
	.append(" and datediff(month,CONVERT(varchar, t_village_signal.insert_day, 120),'").append(qryDate).append("') =0");
	
	if(null!=conditiontext){
		//sql+=" and t_village_signal.name like '%"+conditiontext+"%'";
		sql.append(" and t_village_signal.name like '%").append(conditiontext).append("%'");
	}
	sl=(ArrayList)CatcheUtil.getInstance().getObject(sql.toString());
	if(null==sl || sl.size()<1){
	  sl = query_map0.findAll(sql.toString());
	  CatcheUtil.getInstance().cacheObj(sql.toString(),sl);
	 }
	//sl = query_map0.findAll(sql);
	List sl2=QueryByCounty.village_signal(countys,qryDate,conditiontext);
	if(null!=sl2 && sl2.size()>0)
		sl.addAll(sl2);
	//System.out.println("sql7="+sql);
	QueryMultiConditions.printGoogleMap(sl,channelitems,"coverinfoitem",tablename,fieldmap,out,request,jingzhengs);
}
sql.setLength(0);

//customer information
if(null!=countys&&null!=request.getParameterValues("customeritem"))
{
	//System.out.println("@@@@@@@@customer information@@@@@@@@@@");
	keycodes.add("customeritem");
	channelitems=request.getParameterValues("customeritem");
	//System.out.println("countys.length="+countys.length);
	tablename ="t_town_base";
	for(int i=0;i<townitems.length;i++)
	{
		if(i==0)
		{
			//sql="select t_customer.* from t_customer,t_county where  t_customer.county_name=t_county.county_name and    t_customer.county_name in ('"+countys[i]+"'";
			//sql="select a.*,b.zoom_num,b.ota_num,b.glabal_num,b.tone_total from t_town_base  a,t_town_business b  where a.code=b.code and     a.name in ('"+townitems[i]+"'";
			sql.append("select a.*,b.zoom_num,b.ota_num,b.glabal_num,b.tone_total from t_town_base  a,t_town_business b  where a.code=b.code and     a.name in ('").append(townitems[i]).append("'");
		}
		
		if(i<townitems.length-1)
		{
			//sql+=",'";
			//sql+=townitems[i+1];
			//sql+="'";
			sql.append(",'").append(townitems[i+1]).append("'");
		}
	}
	//sql+= " ) ";
	//sql+= " and datediff(month,CONVERT(varchar, a.insert_day, 120),'"+qryDate+"') =0";
	sql.append(" ) ")
	.append(" and datediff(month,CONVERT(varchar, a.insert_day, 120),'").append(qryDate).append("') =0");
	if(null!=conditiontext){
		//sql+=" and a.name like '%"+conditiontext+"%'";
		sql.append(" and a.name like '%").append(conditiontext).append("%'");
	}
	sl=(ArrayList)CatcheUtil.getInstance().getObject(sql.toString());
	if(null==sl || sl.size()<1){
	  sl = query_map0.findAll(sql.toString());
	  CatcheUtil.getInstance().cacheObj(sql.toString(),sl);
	 }
	//sl = query_map0.findAll(sql);
	//System.out.println("sql4="+sql);
	//System.out.println(sl.get(0));
	QueryMultiConditions.printGoogleMap(sl,channelitems,"customeritem",tablename,fieldmap,out,request,jingzhengs);
}
sql.setLength(0);
//balance office sale
if(null!=request.getParameter("subcorp"))
{
	
	keycodes.add("sg_balance");

	//sql="select a.name,a.x,a.y,b.insert_day,b.the_month, b.the_month_income,b.number_vs_revenue_range,b.cm_market_range,b.incremented_market_range,b.customernum,b.penetration_rate ,a.parent_code,a.company from t_balance_office a,t_balance_office_sale b where   b.code=a.code  and datediff(month,CONVERT(varchar, insert_day, 120),'"+qryDate+"') =0 ";
	sql.append("select a.name,a.x,a.y,b.insert_day,b.the_month, b.the_month_income,b.number_vs_revenue_range,b.cm_market_range,b.incremented_market_range,b.customernum,b.penetration_rate ,a.parent_code,a.company from t_balance_office a,t_balance_office_sale b where   b.code=a.code  and datediff(month,CONVERT(varchar, insert_day, 120),'").append(qryDate).append("') =0 ");
	
	if(null!=conditiontext){
		//sql+=" and a.name like '%"+conditiontext+"%'";
		sql.append(" and a.name like '%").append(conditiontext).append("%'");
	}
	if(jingzhengs!=null)
	{
		//sql+=" and a.company in ('移动',";
		sql.append(" and a.company in ('移动',");
		for (int i = 0; i < jingzhengs.length; i++) {
			//String tmp = jingzhengs[i];
			//sql+="'"+tmp+"'";
			sql.append("'").append(jingzhengs[i]).append("'");
			if(i<jingzhengs.length-1)
			{
				//sql+=" , ";
				sql.append(" , ");
			}
		}
		//sql+=" ) ";
		sql.append(" ) ");
	}
	else
	{
		//sql+=" and a.company='移动' ";
		sql.append(" and a.company='移动' ");
	}
	//sql+="group by a.name,b.the_month,b.insert_day,b.the_month_income,b.number_vs_revenue_range,b.cm_market_range,b.incremented_market_range,b.customernum,b.penetration_rate,a.x,a.y,a.parent_code,a.company ";
	sql.append("group by a.name,b.the_month,b.insert_day,b.the_month_income,b.number_vs_revenue_range,b.cm_market_range,b.incremented_market_range,b.customernum,b.penetration_rate,a.x,a.y,a.parent_code,a.company ");
	String check_sql="select a.name,a.x,a.y,b.insert_day,b.the_month, b.the_month_income,b.number_vs_revenue_range,b.cm_market_range,b.incremented_market_range,b.customernum,b.penetration_rate ,a.parent_code from t_balance_office a,t_balance_office_sale b where   b.code=a.code   and a.company ='移动'  group by a.name,b.the_month,b.insert_day,b.the_month_income,b.number_vs_revenue_range,b.cm_market_range,b.incremented_market_range,b.customernum,b.penetration_rate,a.x,a.y,a.parent_code ";
		//System.out.println(sql);
		String[] subcorps= request.getParameterValues("subcorp");
	//System.out.println("==="+request.getParameter("kpicode"));
		if(request.getParameter("kpicode")!=null)
		
		{
			
			subcorps = new String[]{"name","the_month","the_month_income","number_vs_revenue_range"};
		}
		
		sl=(ArrayList)CatcheUtil.getInstance().getObject(sql.toString());
	if(null==sl || sl.size()<1){
	  sl = query_map0.findAll(sql.toString());
	  CatcheUtil.getInstance().cacheObj(sql.toString(),sl);
	 }
		//sl = query_map0.findAll(sql);
		//System.out.println("sl.size="+sl.size());
		
		//ArrayList changes = ChangeChecker.checkChange(sl);
		//ArrayList changes = ChangeChecker.checkChange(query_map0.findAll(check_sql));
		ArrayList checkls=(ArrayList)CatcheUtil.getInstance().getObject(check_sql);
			if(null==checkls || checkls.size()<1){
			  checkls = query_map0.findAll(check_sql);
			  CatcheUtil.getInstance().cacheObj(check_sql,checkls);
			 }
        HashMap hm_return = (HashMap)ChangeChecker.checkChange(checkls);
		ArrayList changes = (ArrayList)hm_return.get("changepo");
		ArrayList allpo = (ArrayList)hm_return.get("allpo");
		//System.out.println("changes="+changes);
		//System.out.println("changes.size="+changes.size());
		String changeStr="";
		String imagename = "channel_cm.png";
		Map amap = (Map)fieldmap.get("t_balance_office_sale");
		
		//System.out.println("changeStr="+changeStr);
	 	for(Iterator it = sl.iterator();it!=null&&it.hasNext();)
		{
			Map map = (Map)it.next();
			String company = (String)map.get("company");
			//System.out.println(map);
			out.print("point = new GLatLng("+map.get("y")+","+map.get("x")+");");
			
			{
				
				
//				String str="<table width='' border='0'><tr><td width=''><table id=tb1 border=0 cellpadding=0 cellspacing=0 width='300'><tr><td colspan=2 class=t-02>韶关 </td></tr>";
				String str="<div id=picture style='position:absolute; left:319px; top:39px; width:100px; height:82px; z-index:1'></div>";
				str+="<table width='' border='0'><tr><td  width='' valign=top><table  border=0 cellpadding=0 cellspacing=0 width='300' style='border-collapse:collapse'><tr><td width='30%'colspan=2 class=t-01>韶关</td></tr>";
				for(int i=0;null!=subcorps&&i<subcorps.length;i++)
				{
					Map rowmap = (Map) fieldmap.get("t_balance_office");
					Map rowmap2 = (Map) fieldmap.get("t_balance_office_sale");
					str+="<tr><td class=t-03>";
					if("name".equals(subcorps[i])||"x".equals(subcorps[i])||"y".equals(subcorps[i]))
					{
						if(rowmap!=null)
						{
							str+=rowmap.get(subcorps[i])==null?"":rowmap.get(subcorps[i]);
						}
					}
					else //get the data  from t_balance_office_sale
					{
						if(rowmap2!=null)
						{
							str+=rowmap2.get(subcorps[i])==null?"":rowmap2.get(subcorps[i]);
						}
					}
					
					str+="&nbsp;</td><td class=t-04> ";
				
				
					if(map.get(subcorps[i])!=null)
					{
						if(rowmap2.get(subcorps[i]).equals("月收入"))
					    {
					        //String county = request.getParameter("county");
					        String parent_code = (String)map.get("parent_code");
					        str+="<a href='#'";
						    str+=" onclick=callRemote('";
						    str+=parent_code;
						    str+="','the_month_income')>";
							str+=map.get(subcorps[i]);
							str+="</a>";
						}
					    else if(rowmap2.get(subcorps[i]).equals("量收增幅比"))
					    {
					        //String county = request.getParameter("county");
					        String parent_code = (String)map.get("parent_code");
					        str+="<a href='#'";
						    str+=" onclick=callRemote('";
						    str+=parent_code;
						    str+="','number_vs_revenue_range')>";
							str+=map.get(subcorps[i]);
							str+="</a>";
						}
						
						else if(rowmap2.get(subcorps[i]).equals("市场占有率"))
					    {
					        //String county = request.getParameter("county");
					        String parent_code = (String)map.get("parent_code");
					        str+="<a href='#'";
						    str+=" onclick=callRemote('";
						    str+=parent_code;
						    str+="','cm_market_range')>";
							str+=map.get(subcorps[i]);
							str+="</a>";
						}
						
						else if(rowmap2.get(subcorps[i]).equals("总用户数"))
					    {
					        //String county = request.getParameter("county");
					        String parent_code = (String)map.get("parent_code");
					        str+="<a href='#'";
						    str+=" onclick=callRemote('";
						    str+=parent_code;
						    str+="','customernum')>";
							str+=map.get(subcorps[i]);
							str+="</a>";
						}
						else if(rowmap2.get(subcorps[i]).equals("净增市场占有率"))
					    {
					        //String county = request.getParameter("county");
					        String parent_code = (String)map.get("parent_code");
					        str+="<a href='#'";
						    str+=" onclick=callRemote('";
						    str+=parent_code;
						    str+="','incremented_market_range')>";
							str+=map.get(subcorps[i]);
							str+="</a>";
						}
						else if(rowmap2.get(subcorps[i]).equals("市场饱和度"))
					    {
					        //String county = request.getParameter("county");
					        String parent_code = (String)map.get("parent_code");
					        str+="<a href='#'";
						    str+=" onclick=callRemote('";
						    str+=parent_code;
						    str+="','penetration_rate')>";
							str+=map.get(subcorps[i]);
							str+="</a>";
						}
						else
						{
						    str+=map.get(subcorps[i]);
						}
					}
					str+="&nbsp;</td> ";
						
					
					if(i<subcorps.length-1)
					{
						str+=" </tr>";
					}
				}
				
				str+="</table>";
                                //str+="</td> <td rowspan=2><div id=picture>	&nbsp;	</div></td>  </tr>";
				out.print("str=\""+str+"\";");
				
				if("移动".equals(company))
				{
					out.print("var marker=createMarker(point,'channel_cm.png',str);");
					//System.out.println("company="+company);
					if(changes.size()>0)
					{
						imagename="star.png";
						//str=str+"<br>"+changeStr;
						//out.print("str=\""+str+"\";");
						for(Iterator it2 = changes.iterator();it2!=null&&it2.hasNext();)
						{
							ChangePO po =(ChangePO)it2.next();
							//System.out.println("po.getName()="+po.getName()+",map.get()"+map.get("name"));
							if(po.getName().equals(""+map.get("name")))
							{
								StringBuffer buff = new StringBuffer("<tr><td><table id=tb2 border=0 cellpadding=0 cellspacing=0 width='300'><tr><td colspan=2 class=t-02><font color=red>异动指标情况</font></td></tr>");
								for(int i=0; i< po.getContents().size();i++)
								{
									String index = (String)po.getIndexs().get(i);
									
									buff.append("<tr><td class=t-03>").append(amap.get(index)).append(" &nbsp;</td><td class=t-04>").append(po.getContents().get(i)).append("&nbsp;</td></tr> ");
								}
								buff.append("</table>");
								changeStr = buff.toString();
								String tmp=str+changeStr+"</td></tr></table>";
								//tmp+="</td>  <td><div id=picture>	&nbsp;	</div></td>  </tr></table>";
								//System.out.println("tmp="+tmp);
								out.print("str=\""+tmp+"\";");
								
								out.print("marker=createMarker(point,'redstart.gif',str);");
								
								break;
							}
						}
					}
					else
					{
						//str+="</td>  <td><div id=picture>	&nbsp;	</div></td>  </tr></table>";
					}
				
				}
				else if("联通".equals(company))
				{
					out.print("var marker=createMarker(point,'customer_un.png',str);");
				}
				else if("电信".equals(company))
				{
					out.print("var marker=createMarker(point,'customer_tele.png',str);");
				}
				
				out.print("map.addOverlay(marker);");
				out.print("marker.openInfoWindowHtml(str);");
			}
		}

}
sql.setLength(0);
//省公司
if(null!=request.getParameterValues("shengcorp"))

{

	channelitems = request.getParameterValues("shengcorp");
	StringBuffer buff = new StringBuffer();
	if(channelitems.length==1)
	{
		tablename = channelitems[0];
		
		 
		 if("t_province_sale".equals(tablename))
		 {
			buff.append("<table border=0 cellpadding=0 cellspacing=0 width='300'><tr><td  class=t-01 width='30％'>政策指示</td><td class=t-02>&nbsp;</td></tr>");
			buff.append("<tr><td class=t-03 width='30％'>运营数据</td>");
			buff.append("<td class=t-04>&nbsp;</td></tr>");
			
		
			//sql = "select * from t_province_sale where  insert_day =(select max(insert_day) from t_province_sale)";
			//sql+= " and datediff(month,CONVERT(varchar, t_province_sale.insert_day, 120),'"+qryDate+"') =0";
			sql.append("select * from t_province_sale where  insert_day =(select max(insert_day) from t_province_sale)")
			.append(" and datediff(month,CONVERT(varchar, t_province_sale.insert_day, 120),'").append(qryDate).append("') =0");
			sl=(ArrayList)CatcheUtil.getInstance().getObject(sql.toString());
			if(null==sl || sl.size()<1){
			  sl = query_map0.findAll(sql.toString());
			  CatcheUtil.getInstance().cacheObj(sql.toString(),sl);
			 }
			//sl = query_map0.findAll(sql);
			
			if(sl!=null&&sl.size()>0)
			{
				Map map = (Map) sl.get(0);
				buff.append("<tr><td class=t-03  width='30%'>");
				buff.append("市场占有率");
				buff.append("</td>");
				buff.append("<td class=t-04>");
				buff.append(""+map.get("cm_market_range"));
			
				buff.append("</td></tr>");
				
				buff.append("<tr><td class=t-03 width='30%'>");
				buff.append("量收增幅比");
				buff.append("</td>");
				buff.append("<td class=t-04>");
				buff.append(""+map.get("number_vs_revenue_range"));
			
				buff.append("</td></tr>");
				
				
				buff.append("<tr><td class=t-03 width='30%'>");
				buff.append("净增市场占有率 ");
				buff.append("</td>");
				buff.append("<td class=t-04>");
				buff.append(""+map.get("incremented_market_range"));
			
				buff.append("</td></tr>");
				
				
				buff.append("<tr><td class=t-03 width='30%'>");
				buff.append("月收入");
				buff.append("</td>");
				buff.append("<td class=t-04>");
				buff.append(StringUtil.formatDouble((String)map.get("the_month_income")));
			
				buff.append("</td></tr>");
				
				
				buff.append("<tr><td class=t-03 width='30%'>");
				buff.append("用户数");
				buff.append("</td>");
				buff.append("<td class=t-04>");
				buff.append(""+map.get("customernum"));
			
				buff.append("</td></tr>");
				
				
				buff.append("<tr><td class=t-03 width='30%'>");
				buff.append("市场渗透率");
				buff.append("</td>");
				buff.append("<td class=t-04>");
				buff.append(""+map.get("penetration_rate"));
			
				buff.append("</td></tr>");
				
				buff.append("<tr><td class=t-03 width='30%'>");
				buff.append("集团客户数");
				buff.append("</td>");
				buff.append("<td class=t-04>");
				buff.append(""+map.get("group_customernum"));
			
				buff.append("</td></tr>");
				
				buff.append("<tr><td class=t-03 width='30%'>");
				buff.append("月份");
				buff.append("</td>");
				buff.append("<td class=t-04>");
				buff.append(""+map.get("the_month"));
			
				buff.append("</td></tr>");
				
			}
			
			buff.append("</table>");
		 }
		 else if("t_policy".equals(tablename))
		 {
			buff.append("<table border=0 cellpadding=0 cellspacing=0 width='300'><tr><td  class=t-01 width='30％'>政策指示</td>");
			buff.append("<td class=t-02>");
			
			//sql = "select the_content,updated_day from t_policy where (insert_day = (select max(insert_day) from t_policy)) and type   like '%省公司%' ";
			//sql+= " and datediff(month,CONVERT(varchar, t_policy.insert_day, 120),'"+qryDate+"') =0";
			sql.append("select the_content,updated_day from t_policy where (insert_day = (select max(insert_day) from t_policy)) and type   like '%省公司%' ")
			.append(" and datediff(month,CONVERT(varchar, t_policy.insert_day, 120),'").append(qryDate).append("') =0");
			sl=(ArrayList)CatcheUtil.getInstance().getObject(sql.toString());
			
			if(null==sl || sl.size()<1){
			  sl = query_map0.findAll(sql.toString());
			  CatcheUtil.getInstance().cacheObj(sql.toString(),sl);
			 }
			//sl = query_map0.findAll(sql);
			
			if(sl!=null&&sl.size()>0)
			{
				Map map = (Map) sl.get(0);
				buff.append("<a href=t_policy_manage.do?act=list>");
				buff.append(""+map.get("the_content"));
				buff.append("</a>");
				
			}
			else
			{
				buff.append("&nbsp;");
			}
			buff.append("</td></tr>");
			buff.append("<tr><td class=t-03 width='30％'>");
			buff.append("运营情况</td><td class=t-04>&nbsp;</td></tr>");
			buff.append("</table>");
		 }
		 
	
	
	}
	else if(channelitems.length==2)
	{
		//sql = "select the_content,updated_day from t_policy where (insert_day = (select max(insert_day) from t_policy)) and type   like '%省公司%' ";
		//sql+= " and datediff(month,CONVERT(varchar, t_policy.insert_day, 120),'"+qryDate+"') =0";
		sql.append("select the_content,updated_day from t_policy where (insert_day = (select max(insert_day) from t_policy)) and type   like '%省公司%' ")
		.append(" and datediff(month,CONVERT(varchar, t_policy.insert_day, 120),'").append(qryDate).append("') =0");
		
		sl=(ArrayList)CatcheUtil.getInstance().getObject(sql.toString());
		if(null==sl || sl.size()<1){
		  sl = query_map0.findAll(sql.toString());
		  CatcheUtil.getInstance().cacheObj(sql.toString(),sl);
		 }
		//sl = query_map0.findAll(sql);
		buff.append("<table border=0 cellpadding=0 cellspacing=0 width='300'><tr><td  class=t-01 width='30%'>政策指示</td>");
		buff.append("<td class=t-02>");
		if(sl!=null&&sl.size()>0)
		{
			Map map = (Map) sl.get(0);
			buff.append("<a href=t_policy_manage.do?act=list>");
			buff.append(""+map.get("the_content"));
			buff.append("</a>");
			
		}
		else
		{
			buff.append("&nbsp;");
		}
		buff.append("</td></tr>");
		
		buff.append("<tr><td  class=t-03>运营情况</td><td class=t-04>&nbsp;</td></tr>");
		sql.setLength(0);
		
		//sql = "select * from t_province_sale where  updated_day =(select max(updated_day) from t_province_sale)";
		//sql+= " and datediff(month,CONVERT(varchar, t_province_sale.insert_day, 120),'"+qryDate+"') =0";
		sql.append("select * from t_province_sale where  updated_day =(select max(updated_day) from t_province_sale)")
		.append(" and datediff(month,CONVERT(varchar, t_province_sale.insert_day, 120),'").append(qryDate).append("') =0");
		
		sl=(ArrayList)CatcheUtil.getInstance().getObject(sql.toString());
		
		if(null==sl || sl.size()<1){
		  sl = query_map0.findAll(sql.toString());
		  CatcheUtil.getInstance().cacheObj(sql.toString(),sl);
		 }
		//sl = query_map0.findAll(sql);
		
		if(sl!=null&&sl.size()>0)
		{
			Map map = (Map) sl.get(0);
			buff.append("<tr><td class=t-03>");
			buff.append("市场占有率");
			buff.append("</td>");
			buff.append("<td class=t-04>");
			buff.append(""+map.get("cm_market_range"));
		
			buff.append("</td></tr>");
			
			buff.append("<tr><td class=t-03>");
			buff.append("量收增幅比");
			buff.append("</td>");
			buff.append("<td class=t-04>");
			buff.append(""+map.get("number_vs_revenue_range"));
		
			buff.append("</td></tr>");
			
			
			buff.append("<tr><td class=t-03>");
			buff.append("净增市场占有率 ");
			buff.append("</td>");
			buff.append("<td class=t-04>");
			buff.append(""+map.get("incremented_market_range"));
		
			buff.append("</td></tr>");
			
			
			buff.append("<tr><td class=t-03>");
			buff.append("月收入");
			buff.append("</td>");
			buff.append("<td class=t-04>");
			buff.append(StringUtil.formatDouble((String)map.get("the_month_income")));
		
			buff.append("</td></tr>");
			
			
			buff.append("<tr><td class=t-03>");
			buff.append("用户数");
			buff.append("</td>");
			buff.append("<td class=t-04>");
			buff.append(""+map.get("customernum"));
		
			buff.append("</td></tr>");
			
			
			buff.append("<tr><td class=t-03>");
			buff.append("市场渗透率");
			buff.append("</td>");
			buff.append("<td class=t-04>");
			buff.append(""+map.get("penetration_rate"));
		
			buff.append("</td></tr>");
			
			buff.append("<tr><td class=t-03>");
			buff.append("集团客户数");
			buff.append("</td>");
			buff.append("<td class=t-04>");
			buff.append(""+map.get("group_customernum"));
		
			buff.append("</td></tr>");
			
			buff.append("<tr><td class=t-03>");
			buff.append("月份");
			buff.append("</td>");
			buff.append("<td class=t-04>");
			buff.append(""+map.get("the_month"));
		
			buff.append("</td></tr>");
		}
		buff.append("</table>");
		}
	out.print("baseIcon.iconSize = new GSize(40, 46);");	
	out.print("point = new GLatLng(23.139097,113.300629);");
	out.print("str=\""+buff.toString()+"\";");
	out.print("marker=createMarker(point,'guangdong.png',str);");
	out.print("map.addOverlay(marker);");
	out.print("marker.openInfoWindowHtml(str);");	
	keycodes.add("city");
}
//韶关
//////////////////////////////情报信息///////////////////////
sql.setLength(0);
if(null!=request.getParameterValues("sginfomation"))

{
	channelitems = request.getParameterValues("sginfomation");
	StringBuffer buff = new StringBuffer();
	if(channelitems.length==1)
	{
		tablename = channelitems[0];
		
		 
		 if("t_information".equals(tablename))
		 {
			buff.append("<table border=0 cellpadding=0 cellspacing=0 width='250'><tr><td  class=t-01 width='25％'>政策指示</td><td class=t-02>&nbsp;</td></tr>");
			buff.append("<tr><td class=t-03 width='25％'>情报信息</td>");
			buff.append("<td class=t-04>&nbsp;</td></tr>");
			
			String tmpsql=SqlCreator.informationSql(qryDate,request);
			sl=(ArrayList)CatcheUtil.getInstance().getObject(tmpsql);
			if(null==sl || sl.size()<1){
			  sl=query_map0.findAll(tmpsql);
			  CatcheUtil.getInstance().cacheObj(tmpsql,sl);
			 }
			
			
			if(sl!=null&&sl.size()>0)
			{
				Map map = (Map) sl.get(0);
				buff.append("<tr><td class=t-03>");
				buff.append("名称");
				buff.append("</td>");
				buff.append("<td class=t-04>");
				buff.append(""+map.get("name"));
			
				buff.append("</td></tr>");
				
				buff.append("<tr><td class=t-03>");
				buff.append("内容");
				buff.append("</td>");
				buff.append("<td class=t-04>");
				buff.append(StringUtil.filter(""+map.get("content")));
			
				buff.append("</td></tr>");
				
				
				buff.append("<tr><td class=t-03>");
				buff.append("紧急程度 ");
				buff.append("</td>");
				buff.append("<td class=t-04>");
				buff.append(""+map.get("leveltype"));
			
				buff.append("</td></tr>");
			
				
				buff.append("<tr><td class=t-03>");
				buff.append("保密类型");
				buff.append("</td>");
				buff.append("<td class=t-04>");
				buff.append(((String)map.get("opentype")));
			
				buff.append("</td></tr>");
						
			}
			
			buff.append("</table>");
			
		 }
		 else if("t_policy".equals(tablename))
		 {
			buff.append("<table border=0 cellpadding=0 cellspacing=0 width='250'><tr><td  class=t-01 width='30％'>政策指示</td>");
			buff.append("<td class=t-02>");
			//sql = "select the_content,updated_day from t_policy where (insert_day = (select max(insert_day) from t_policy )) and type   like '%韶关%' ";
			//sql+= " and datediff(month,CONVERT(varchar, t_policy.insert_day, 120),'"+qryDate+"') =0";
			sql.append("select the_content,updated_day from t_policy where (insert_day = (select max(insert_day) from t_policy )) and type   like '%韶关%' ")
			.append(" and datediff(month,CONVERT(varchar, t_policy.insert_day, 120),'").append(qryDate).append("') =0");
			sl=(ArrayList)CatcheUtil.getInstance().getObject(sql.toString());
			if(null==sl || sl.size()<1){
			  sl = query_map0.findAll(sql.toString());
			  CatcheUtil.getInstance().cacheObj(sql.toString(),sl);
			 }
			//sl = query_map0.findAll(sql);
			
			if(sl!=null&&sl.size()>0)
			{
				Map map = (Map) sl.get(0);
				buff.append("<a href=t_policy_manage.do?act=list>");
				buff.append(""+map.get("the_content"));
				buff.append("</a>");
				
			}
			else
			{
				buff.append("&nbsp;&nbsp;");
			}
			buff.append("</td></tr>");
			buff.append("<tr><td class=t-03 width='30％'>");
			buff.append("情报信息</td><td class=t-04>&nbsp;</td></tr>");
			buff.append("</table>");
			//System.out.println("sql="+sql);
		 }
		 
	
	
	}
	else if(channelitems.length==2)
	{
		//sql = "select the_content,updated_day from t_policy where (insert_day = (select max(insert_day) from t_policy )) and type   like '%韶关%' ";
		//sql+= " and datediff(month,CONVERT(varchar, t_policy.insert_day, 120),'"+qryDate+"') =0";
		sql.append("select the_content,updated_day from t_policy where (insert_day = (select max(insert_day) from t_policy )) and type   like '%韶关%' ")
		.append(" and datediff(month,CONVERT(varchar, t_policy.insert_day, 120),'").append(qryDate).append("') =0");
		sl=(ArrayList)CatcheUtil.getInstance().getObject(sql.toString());
		if(null==sl || sl.size()<1){
		  sl = query_map0.findAll(sql.toString());
		  CatcheUtil.getInstance().cacheObj(sql.toString(),sl);
		 }
		buff.append("<table border=0 cellpadding=0 cellspacing=0 ><tr><td  class=t-01 width='60'>政策指示</td>");
		buff.append("<td class=t-02>");
		if(sl!=null&&sl.size()>0)
		{
			Map map = (Map) sl.get(0);
			buff.append("<a href=t_policy_manage.do?act=list>");
			buff.append(""+map.get("the_content"));
			buff.append("</a>");
		}
		else
		{
			buff.append("&nbsp;");
		}
		buff.append("</td></tr>");
		
		buff.append("<tr><td  class=t-03 width='60'>情报信息</td><td class=t-04 width='300'>&nbsp;</td></tr>");
		
		String tmpsql=SqlCreator.informationSql(qryDate,request);
		sl=(ArrayList)CatcheUtil.getInstance().getObject(tmpsql);
		if(null==sl || sl.size()<1){
		  sl = query_map0.findAll(tmpsql);
		  CatcheUtil.getInstance().cacheObj(tmpsql,sl);
		 }
		if(sl!=null&&sl.size()>0)
		{
			Map map = (Map) sl.get(0);
			buff.append("<tr><td class=t-03 width='60'>");
			buff.append("名称");
			buff.append("</td>");
			buff.append("<td class=t-04 width='300'>");
			buff.append(""+map.get("name"));
		
			buff.append("</td></tr>");
			
			buff.append("<tr><td class=t-03 >");
			buff.append("内容");
			buff.append("</td>");
			buff.append("<td class=t-04 >");
			buff.append(StringUtil.filter(""+map.get("content")));
		
			buff.append("</td></tr>");
			
			
			buff.append("<tr><td class=t-03 >");
			buff.append("紧急程度 ");
			buff.append("</td>");
			buff.append("<td class=t-04>");
			buff.append(""+map.get("leveltype"));
		
			buff.append("</td></tr>");
			
			
			buff.append("<tr><td class=t-03>");
			buff.append("保密类型");
			buff.append("</td>");
			buff.append("<td class=t-04>");
			buff.append(((String)map.get("opentype")));
		
			buff.append("</td></tr>");
			
			
			
		
		
		}
		buff.append("</table>");
	}
		//System.out.println("buff="+buff.toString());
	out.print("baseIcon.iconSize = new GSize(40, 46);");
	out.print("point = new GLatLng(24.798267,113.600349);");
	out.print("str=\""+buff.toString()+"\";");
	
	out.print("marker=createMarker(point,'shaoguan.png',str);");
	out.print("map.addOverlay(marker);");
	out.print("marker.openInfoWindowHtml(str);");	
	keycodes.add("city");
	
	
	//sql ="select  id,name,content,county,updated_day from t_information group by county,updated_day,name,id,content order by county,updated_day desc;";
	String tmpsql2=SqlCreator.informationSql2(request);
	sl=(ArrayList)CatcheUtil.getInstance().getObject(tmpsql2);
	if(null==sl || sl.size()<1){
	  sl = query_map0.findAll(tmpsql2);
	  CatcheUtil.getInstance().cacheObj(tmpsql2,sl);
	 }
	//sl = query_map0.findAll(sql);
	String county_name = "";
	Map<String,Map> maps = new HashMap<String,Map>();
	int i=0;
	for(Iterator it = sl.iterator();it!=null&&it.hasNext();i++)
	{
	 	Map map = (Map)it.next();
		if(i==0)
		{
			county_name = (String)map.get("county");
			maps.put(county_name, map);
			continue;
		}
		String county = (String)map.get("county");
		if(!county.equals(county_name))
		{
			county_name= county;
			maps.put(county_name, map);
		}
		
	}
	sql.setLength(0);
	String tmpcountysql ="select c.* from t_county  c where  county_name  not in ( '韶关%' ,'广东省')";
	
	sl=(ArrayList)CatcheUtil.getInstance().getObject(tmpcountysql);
	if(null==sl || sl.size()<1){
	  sl = query_map0.findAll(tmpcountysql);
	  CatcheUtil.getInstance().cacheObj(tmpcountysql,sl);
	 }
	//sl = query_map0.findAll(sql);
	
	 for(Iterator it = sl.iterator();it!=null&&it.hasNext();)
	 {
	 	Map map = (Map)it.next();
	 	buff = new StringBuffer();
		if(null==map.get("y")||null==map.get("x")||"".equals(map.get("y"))||"".equals(map.get("x"))||"0.0".equals(map.get("y"))||"0.0".equals(map.get("x")))
		{
			continue;
		}
		buff.append("<table border=0 cellpadding=0 cellspacing=0 width=300><tr><td  class=t-01 width='30%'>情报信息</td>");
	 	
		buff.append("<td class=t-02>");
		String county = ""+map.get("county_name");
		Map row = maps.get(county);
		if(row!=null)
		{
			String content = ""+row.get("content");
			content = StringUtil.filter(content);
			buff.append(content);
		}
		else
			buff.append("&nbsp;");
		buff.append("</td></tr>");
		buff.append("</table>");
		out.print("point = new GLatLng("+map.get("y")+","+map.get("x")+");");
		out.print("str=\""+buff.toString()+"\";");
		//out.print("GLog.write(str);");
		
		if("乐昌".equals(""+map.get("county_name")))
		{
			out.print("marker = createMarker(point,'"+"lechang.png"+"',str);");
		}
		else if("南雄".equals(""+map.get("county_name")))
		{
			out.print("marker = createMarker(point,'"+"nanxiong.png"+"',str);");
		}
		else if("乳源".equals(""+map.get("county_name")))
		{
			out.print("marker = createMarker(point,'"+"ruyuan.png"+"',str);");
		}
		else if("仁化".equals(""+map.get("county_name")))
		{
			out.print("marker = createMarker(point,'"+"renhu.png"+"',str);");
		}
		else if("曲江".equals(""+map.get("county_name")))
		{
			out.print("marker = createMarker(point,'"+"qujiang.png"+"',str);");
		}
		else if("乳源".equals(""+map.get("county_name")))
		{
			out.print("marker = createMarker(point,'"+"shixing.png"+"',str);");
		}
		else if("翁源".equals(""+map.get("county_name")))
		{
			out.print("marker = createMarker(point,'"+"wengyuan.png"+"',str);");
		}
		else if("新丰".equals(""+map.get("county_name")))
		{
			out.print("marker = createMarker(point,'"+"xinfeng.png"+"',str);");
		}
		else if("始兴".equals(""+map.get("county_name")))
		{
			out.print("marker = createMarker(point,'"+"shixing.png"+"',str);");
		}
		
		
		//System.out.println(buff.toString());
		out.print("map.addOverlay(marker);");
		//out.print("marker.openInfoWindowHtml(str);");	
	}
	
}


	String kpi_code=request.getParameter("kpi_code");
	
	if(kpi_code==null||kpi_code.equals(""))
	{
		kpi_code="living_standard";
	}

	




if(keycodes.size()==0)
	keycodes.add("sg_channel");
	 
	 

      out.write("\r\n");
      out.write("\t  }\r\n");
      out.write("    }\r\n");
      out.write("\t\r\n");
      out.write("\tfunction createMarker(point, imageName,html) {\r\n");
      out.write("          \r\n");
      out.write("          var letteredIcon = new GIcon(baseIcon);\r\n");
      out.write("          letteredIcon.image = \"images/\"+imageName;\r\n");
      out.write("\t\t  \r\n");
      out.write("          // 设置 GMarkerOptions 对象\r\n");
      out.write("          markerOptions = { icon:letteredIcon,noCloseOnClick:true };\r\n");
      out.write("          var marker = new GMarker(point, markerOptions);\r\n");
      out.write("\r\n");
      out.write("          GEvent.addListener(marker, \"click\", function() {\r\n");
      out.write("\t\t  //alert(\" map.getInfoWindow()=\"+ map.getInfoWindow());\r\n");
      out.write("            marker.openInfoWindowHtml(\"<div class='ipt' id=popupWin>\" + html + \"</div>\");\r\n");
      out.write("          });\r\n");
      out.write("          return marker;\r\n");
      out.write("        }\r\n");
      out.write("\t\t\r\n");
      out.write("\tfunction createMarker3(point, imageName,html) {\r\n");
      out.write("          \r\n");
      out.write("\t\t  baseIcon1 = new GIcon();\r\n");
      out.write("\t\t  baseIcon1.shadow = \"http://www.google.com/mapfiles/shadow50.png\";\r\n");
      out.write("\t\t  baseIcon1.iconSize = new GSize(38, 32);\r\n");
      out.write("\t\t  baseIcon1.shadowSize = new GSize(37, 34);\r\n");
      out.write("\t\t  baseIcon1.iconAnchor = new GPoint(9, 34);\r\n");
      out.write("\t\t  baseIcon1.infoWindowAnchor = new GPoint(9, 2);\r\n");
      out.write("\t\t  baseIcon1.infoShadowAnchor = new GPoint(18, 25);\r\n");
      out.write("          var letteredIcon = new GIcon(baseIcon1);\r\n");
      out.write("          letteredIcon.image = \"images/\"+imageName;\r\n");
      out.write("\t\t  //alert(letteredIcon.image);\r\n");
      out.write("\t\t  \r\n");
      out.write("          // 设置 GMarkerOptions 对象\r\n");
      out.write("          markerOptions = { icon:letteredIcon };\r\n");
      out.write("          var marker = new GMarker(point, markerOptions);\r\n");
      out.write("\r\n");
      out.write("          GEvent.addListener(marker, \"click\", function() {\r\n");
      out.write("            marker.openInfoWindowHtml(\"<div class='ipt' id=popupWin>\" + html + \"</div>\");\r\n");
      out.write("          });\r\n");
      out.write("          return marker;\r\n");
      out.write("        }\r\n");
      out.write("        function createMarker2(point, imageName,html) {\r\n");
      out.write("          \r\n");
      out.write("\t\t  baseIcon1 = new GIcon();\r\n");
      out.write("\t\t  baseIcon1.shadow = \"http://www.google.com/mapfiles/shadow50.png\";\r\n");
      out.write("\t\t  baseIcon1.iconSize = new GSize(140, 46);\r\n");
      out.write("\t\t  baseIcon1.shadowSize = new GSize(2, 2);\r\n");
      out.write("\t\t  baseIcon1.iconAnchor = new GPoint(9, 34);\r\n");
      out.write("\t\t  baseIcon1.infoWindowAnchor = new GPoint(9, 2);\r\n");
      out.write("\t\t  baseIcon1.infoShadowAnchor = new GPoint(2, 2);\r\n");
      out.write("          var letteredIcon = new GIcon(baseIcon1);\r\n");
      out.write("          letteredIcon.image = \"images/\"+imageName;\r\n");
      out.write("\t\t  //alert(letteredIcon.image);\r\n");
      out.write("\t\t  \r\n");
      out.write("          // 设置 GMarkerOptions 对象\r\n");
      out.write("          markerOptions = { icon:letteredIcon };\r\n");
      out.write("          var marker = new GMarker(point, markerOptions);\r\n");
      out.write("\r\n");
      out.write("          GEvent.addListener(marker, \"click\", function() {\r\n");
      out.write("            marker.openInfoWindowHtml(\"<div class='ipt' id=popupWin>\" + html + \"</div>\");\r\n");
      out.write("          });\r\n");
      out.write("          return marker;\r\n");
      out.write("        }\r\n");
      out.write("\t\t\r\n");
      out.write("\t\tfunction callRemote(county,aitem)\r\n");
      out.write("{\r\n");
      out.write("\t\r\n");
      out.write("\t\r\n");
      out.write("\t//alert(document.all.channelitem);\r\n");
      out.write("\t\r\n");
      out.write("\tvar url = 'AjaxSubCorpServlet?county='+county+'&item='+aitem;  \r\n");
      out.write("\tgetResult(url);\r\n");
      out.write("\t//alert(url);\r\n");
      out.write("}\t\r\n");
      out.write("function callCustRemote(county)\r\n");
      out.write("\t\t{\r\n");
      out.write("\t\r\n");
      out.write("\t\t\t\r\n");
      out.write("\t\t\t//alert(document.all.channelitem);\r\n");
      out.write("\t\t\t\r\n");
      out.write("\t\t\tvar url = 'AjaxCustomerServlet?county='+county\r\n");
      out.write("\t\t\tgetCustResult(url);\r\n");
      out.write("//\t\t\talert(url);\r\n");
      out.write("\t\t}\r\n");
      out.write("\t\t\r\n");
      out.write("function getCustResult(url)\r\n");
      out.write("{  \r\n");
      out.write("\t//var url = \"AjaxServlet?action=send\";  \r\n");
      out.write("\tif (window.XMLHttpRequest) \r\n");
      out.write("\t{     req = new XMLHttpRequest();   \r\n");
      out.write("\t}\r\n");
      out.write("\telse if (window.ActiveXObject)\r\n");
      out.write("\t{     \r\n");
      out.write("\treq = new ActiveXObject(\"Microsoft.XMLHTTP\");   \r\n");
      out.write("\t}   \r\n");
      out.write("\tif(req)\r\n");
      out.write("\t{  \r\n");
      out.write("\t\t\r\n");
      out.write("\t\treq.open(\"GET\",url, true);      \r\n");
      out.write("\t\treq.onreadystatechange = custcomplete;      \r\n");
      out.write("\t\treq.send(null);   \r\n");
      out.write("\t} \r\n");
      out.write("} \r\n");
      out.write("function getResult(url)\r\n");
      out.write("{  \r\n");
      out.write("\t//var url = \"AjaxServlet?action=send\";  \r\n");
      out.write("\tif (window.XMLHttpRequest) \r\n");
      out.write("\t{     req = new XMLHttpRequest();   \r\n");
      out.write("\t}\r\n");
      out.write("\telse if (window.ActiveXObject)\r\n");
      out.write("\t{     \r\n");
      out.write("\treq = new ActiveXObject(\"Microsoft.XMLHTTP\");   \r\n");
      out.write("\t}   \r\n");
      out.write("\tif(req)\r\n");
      out.write("\t{  \r\n");
      out.write("\t\t\r\n");
      out.write("\t\treq.open(\"GET\",url, true);      \r\n");
      out.write("\t\treq.onreadystatechange = complete;      \r\n");
      out.write("\t\treq.send(null);   \r\n");
      out.write("\t} \r\n");
      out.write("} \r\n");
      out.write("function custcomplete()\r\n");
      out.write("{  \r\n");
      out.write("//alert(1);\r\n");
      out.write("\tvar strResult;\r\n");
      out.write("\tif(req.readyState == 4) \r\n");
      out.write("\t{     \r\n");
      out.write("\t\tif (req.status == 200) \r\n");
      out.write("\t\t{      \r\n");
      out.write("\r\n");
      out.write("\t\t strResult = (req.responseText);   \r\n");
      out.write("\t\t //alert('strResult='+strResult);\r\n");
      out.write("\t\t document.getElementById('custpicture').innerHTML =strResult;  \r\n");
      out.write("\r\n");
      out.write("\t\t  \r\n");
      out.write("\t\t}  \r\n");
      out.write("\t}\r\n");
      out.write("\treturn strResult;\r\n");
      out.write("}\r\n");
      out.write("/*分析返回的文本文档*/\r\n");
      out.write("function complete()\r\n");
      out.write("{  \r\n");
      out.write("//alert(1);\r\n");
      out.write("\tvar strResult;\r\n");
      out.write("\tif(req.readyState == 4) \r\n");
      out.write("\t{     \r\n");
      out.write("\t\tif (req.status == 200) \r\n");
      out.write("\t\t{      \r\n");
      out.write("\t\t //alert(req.responseText);  \r\n");
      out.write("\t\t strResult = (req.responseText);   \r\n");
      out.write("\t\t //document.getElementById('popupWin').style.width=600;\r\n");
      out.write("\t\t //document.getElementById('tb1').style.width=600;\r\n");
      out.write("\t\t //document.getElementById('tb2').style.width=600;\r\n");
      out.write("\t\t //document.getElementById('popupWin').style.height=270;\r\n");
      out.write("\t\t //alert(document.getElementById('popupWin'));\r\n");
      out.write("\t\t document.getElementById('picture').innerHTML =strResult;  \r\n");
      out.write("\t\t //marker.openInfoWindowHtml(\"<div class='ipt' id=popupWin>\" + \"test\" + \"</div>\");\r\n");
      out.write("\t\t //alert(map);\r\n");
      out.write("\t\t//map.openInfoWindow(map.getCenterLatLng(), document.createTextNode(\"Hello world\"));\r\n");
      out.write("\t\t//var currentWin = map.getInfoWindow();\r\n");
      out.write("\t\t//alert(currentWin.isHidden());\r\n");
      out.write("\t\t//map.openInfoWindow( map.getCenter(),document.createTextNode(strResult),   {noCloseOnClick:true} ); \r\n");
      out.write("\t\t//map.bindInfoWindowHtml(\"DEN<br/>Denver International Airport\");\r\n");
      out.write("\r\n");
      out.write("\t\t//currentWin.hide();\r\n");
      out.write("\t\t//alert(1);\r\n");
      out.write("\t\t/*\r\n");
      out.write("\t\ttabs = new Array()\r\n");
      out.write("\t\tvar tab = new GInfoWindowTab('Tab1','<a onclick=test()>My Tab1</a>'); \r\n");
      out.write("\t\ttabs.push(tab); \r\n");
      out.write("\t\tvar tab = new GInfoWindowTab('Tab2','My Tab2'); \r\n");
      out.write("\t\ttabs.push(tab); \r\n");
      out.write("\t\t\r\n");
      out.write("\t\tmap.openInfoWindowTabsHtml(map.getCenter(),tabs) \r\n");
      out.write("\t\t\r\n");
      out.write("\t\t*/\r\n");
      out.write("\t\t//currentWin.show();\r\n");
      out.write("\t\t\r\n");
      out.write("\t\t  \r\n");
      out.write("\t\t}  \r\n");
      out.write("\t}\r\n");
      out.write("\treturn strResult;\r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("function test()\r\n");
      out.write("{\r\n");
      out.write("\ttabs =map.getInfoWindow().getTabs();\r\n");
      out.write("\ttab1= tabs[1];\r\n");
      out.write("\t//alert(tab1.label);\r\n");
      out.write("\tmap.getInfoWindow().selectTab(1);\r\n");
      out.write("}\r\n");
      out.write("\t\t\r\n");
      out.write("//展示google地图\r\n");
      out.write("\r\n");
      out.write("</script>\r\n");
      out.write("<body onLoad=\"initialize()\" onUnload=\"GUnload()\" style=\"overflow-x:hidden;overflow-y:hidden\">\r\n");
      out.write("<input type=\"button\" value=\"ceshi\" onclick=\"loadChannel();\">\r\n");
      out.write("<input type=\"hidden\" id=\"screen\" value=\"1\">\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<div id=\"map_canvas\" style=\"position:absolute;width: 102%; height: 100%;\" ></div>\r\n");
      out.write("<script>\r\n");
      out.write("var height=screen.height;\r\n");
      out.write("var width = screen.width;\r\n");
      out.write("// menu frame object\r\n");
      out.write("var menuFrame = window.top.document.frames(1);\r\n");
      out.write("//map frame object\r\n");
      out.write("var mapFrame = window.top.document.frames(2);\r\n");
      out.write("//alert(\"height=\"+(height-56-72));\r\n");
      out.write("//alert(\"width=\"+(width-150));\r\n");
      out.write("var scrollbarHeight=20;\r\n");
      out.write("//document.getElementById(\"map_canvas\").style.height= (height-56-72-2*scrollbarHeight);\r\n");
      out.write("//document.getElementById(\"map_canvas\").style.width =(width-168-1.6*scrollbarHeight);\r\n");
      out.write("</script>\r\n");
      out.write("    \r\n");
      out.write("<script>\r\n");

String kpicodes="";
 for(Iterator it = keycodes.iterator();it!=null&&it.hasNext();)
 {
 	kpicodes+= "kpi_code="+it.next();
	if(it.hasNext())
	{
		kpicodes+="&";
	}
 }

      out.write("\r\n");
      out.write("top.stateFrame.location.href='show_legend_googlemap.jsp?");
      out.print(kpicodes);
      out.write("';\r\n");
      out.write("map.setMapType(G_NORMAL_MAP);\r\n");
      out.write("</script>\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("</html>\r\n");
      out.write("<script>\r\n");
      out.write("\tfunction loadChannel(){\r\n");
      out.write("\t\t//alert('sfskfjklj');\r\n");
      out.write("\t\tvar url=\"");
      out.print(request.getContextPath());
      out.write("/loadMapInfoAjax\";\r\n");
      out.write("\t\t\r\n");
      out.write("\t\tvar myAjax = new Ajax.Request(\r\n");
      out.write("\t\t\t\t\turl, \r\n");
      out.write("\t\t\t\t\t{ \r\n");
      out.write("\t\t\t\t\t\tmethod: 'get', \r\n");
      out.write("\t\t\t\t\t\tasynchronous:false\r\n");
      out.write("\t\t\t\t}); \r\n");
      out.write("\t\tvar myXML = myAjax.transport.responseXML; \r\n");
      out.write("\t\t//var myXML = myAjax.transport.responseText;\r\n");
      out.write("\t\tif (myXML.documentElement == null) {\r\n");
      out.write("\t\t\t\t\talert('没有数据！');\r\n");
      out.write("\t\t} else {\r\n");
      out.write("\t\t\t\t  alert(myXML.xml);\r\n");
      out.write("\t\t\t}\r\n");
      out.write("\t}\r\n");
      out.write("var req2=null;\r\n");
      out.write("function getMapInfo(url)\r\n");
      out.write("{  \r\n");
      out.write("\t\r\n");
      out.write("\tif (window.XMLHttpRequest) \r\n");
      out.write("\t{     req2 = new XMLHttpRequest();   \r\n");
      out.write("\t}\r\n");
      out.write("\telse if (window.ActiveXObject)\r\n");
      out.write("\t{     \r\n");
      out.write("\treq2 = new ActiveXObject(\"Microsoft.XMLHTTP\");   \r\n");
      out.write("\t}   \r\n");
      out.write("\tif(req2)\r\n");
      out.write("\t{  \r\n");
      out.write("\t\t\r\n");
      out.write("\t\treq2.open(\"GET\",url, true);      \r\n");
      out.write("\t\treq2.onreadystatechange = parseMapInfo;      \r\n");
      out.write("\t\treq2.send(null);   \r\n");
      out.write("\t} \r\n");
      out.write("} \r\n");
      out.write("function parseMapInfo(){\r\n");
      out.write("\t\r\n");
      out.write("\tvar strResult;\r\n");
      out.write("\tif(req2.readyState == 4) {     \r\n");
      out.write("\t\tif (req2.status == 200) {      \r\n");
      out.write("\t\t \tstrResult = (req2.responseText); \r\n");
      out.write("\t\t \t\r\n");
      out.write("\t\t \talert('strResult='+strResult); \r\n");
      out.write("\t\t \tpoint = new GLatLng(24.814413776148065,113.59066128730774);\r\n");
      out.write("\t\t\tmap.addOverlay(createMarker(point,1,'中国移动通信武江北服务厅'));\r\n");
      out.write("\t\t }\r\n");
      out.write("\t}\r\n");
      out.write("\r\n");
      out.write("}\r\n");
      out.write("</script>");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
